from fastapi import FastAPI
import log_test

app = FastAPI()

@app.get("/get-num")
async def get_num(number: int | None = 0):
    if number != 0:
        log_test.global_var = number
    return {"number": log_test.global_var}

@app.get("/get-var")
async def get_var():
    return {"number": log_test.global_var}


if __name__ == "__main__":
    import uvicorn
    uvicorn.run(app, host="0.0.0.0", port=8000)